Skip to main content

useless scheme

  `((define (func exp) (if (= nil exp) (nil) (append (car exp) (cdr exp))))

  (if ,condition (append 'begin func(,exprs)) (print 'okay)))
`(if ,condition (begin (car ,exprs)))

`(if ,condition (append '(begin) ,exprs) (print 'okay))
  (if (= (eval expr) (car (car cases))) (cdr (car cases)) (switch expr (cdr cases)))
(define-macro (switch expr cases)

  (cons eval

    (map ( (lambda (case) (= (car case) (eval expr))) (cons _________ (cdr case)))

          cases)

  )

)
(define-macro (switch expr cases)

    (cons eval

        (map (lambda (case) (= (eval expr) (car case)) (cons list (cdr case)))

                cases))

)

Actually kinda useful

    (cons 'eval

        (map (lambda (case) (cons `(if (not (= (car ,case) ,expr)) nil) (cdr case)))

                cases))
    (cons 'eval
    (map (lambda (case) (cons (if (not (= (car case) expr)) nil) (cdr case)))

                cases))
    (cons 'eval

        (map (lambda (case) (cons (list 'if (list = (car case) (expr)) nil 'eval)

         (cdr case)))

                cases)

    )

Working scheme code:

(if (eval condition) (append (list 'begin) exprs) (print 'okay))
    (cons 'begin

    (map (lambda (case) (cons

    (cons 'if

    (cons =

    (cons (list (car case))

    (cons expr

    nil)))) (cdr case))) cases

    )

    )
((= (cdr s) nil) (car s))

  ((pred (car s)) (cons (car s) (my-filter pred (cdr s))))



 (else (my-filter pred (cdr s)))

 )
(+ (joiner start (term n)) (accumulate joiner 0 (- n 1) term))